
<link rel="stylesheet" href="../addons/jy_sns/custom/templates/mobile/images/common.css?v=20191101" />
<style>
    .fui-cell.complain-image{display: block;}
</style>
<div ng-if="pagedata.op=='main'"  id="sns-board-post-page" class='fui-page fui-page-current sns-post-detail-page'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback()"></a>
        </div>
        <div class="title">话题</div>
        <div class="fui-header-right">&nbsp;</div>
    </div>
    <div class="fui-content">
        <div class="fui-list-group" style="margin-top:0;">
            <a class="fui-list" ng-click="access_json('/user.index//id='+pagedata.post.mid)" data-nocache="true">
                <div class="fui-list-media post-detail-avatar">
                    <img ng-src="{{tomedia(pagedata.post.avatar) || '../core/resource/images/nopic.jpg'}}" class="round">
                </div>
                <div class="fui-list-inner">
                    <div class="subtitle">{{pagedata.post.nickname}}
                    <span class="level-label fui-label fui-label-default level-label" style="background:{{level.bg}};color:{{level.color}}">{{pagedata.level.levelname || '普通会员'}}</span>
                       
                        <span ng-if="pagedata.pisManager==1" class="level-label fui-label fui-label-danger level-label">版主</span>
                       

                    </div>
                    <div class="text text-remark">{{pagedata.member.sns_sign}}</div>
                </div>
                <div class="fui-list-angle">
                    <div class="angle"></div>
                </div>
            </a>
        </div>

        <div class="fui-article">
            <div class="fui-article-title">
                <span ng-if="pagedata.post.isbest==1 || pagedata.post.isboardbest==1" id="bestspan" class="fui-label fui-label-warning" >精</span>
                {{pagedata.post.title}}
            </div>
            <div class="fui-article-subtitle">
                {{pagedata.post.createtime}} <a class="board-label external" ng-click="access_json('/board.index//id='+pagedata.board.id)" >{{pagedata.board.title}}</a>
            </div>
            <div class="fui-article-content  content content-images" ng-bind-html='trust(pagedata.post.content)'></div>
			<div class="fui-article-content  content content-images" ng-if="pagedata.post.images.length>0">
					<img ng-repeat="p in pagedata.post.images" ng-src="{{tomedia(p)}}"/>
			</div>
            <div class="fui-article-subtitle func">      
                <span ng-if="pagedata.isSuperManager!=1" class="pull-right">
                    <i class="icon icon-browse"></i> {{pagedata.post.views}}
                </span> 
				<a ng-if="pagedata.isSuperManager==1 || pagedata.isManager==1 || pagedata.self==1" href="javascript:;" class="link" id="btnDelete"  > <span ng-click='pagedata.delete(pagedata.post.id)' class="icon jinyunicon icon-delete">删除</span> </a>
               <a ng-if="pagedata.isSuperManager==1 || pagedata.isManager==1 " ng-if="pagedata.post.checked!=1" class="link" id="btnCheck"  ><i class="icon icon-creditlevel"></i> <span ng-click='pagedata.check(pagedata.post.id)' class="icon jinyunicon icon-check">审核通过</span> </a>
                <a ng-if="pagedata.isSuperManager==1 || pagedata.isManager==1" href="javascript:;" class="link" id="btnBest" isbest="{{pagedata.post.isboardbest}}" ><i class="icon icon-creditlevel"></i> <span ng-click='pagedata.boardbest(pagedata.post.id)' ng-if="pagedata.post.isboardbest!=1" class="bestdiv">设置精华</span> <span ng-click='pagedata.boardbest(pagedata.post.id)' ng-if="pagedata.post.isboardbest==1" class="bestdiv">取消精华</span>&nbsp;</a>
                <a ng-if="pagedata.isSuperManager==1 || pagedata.isManager==1" href="javascript:;" class="link" id="btnTop" istop="{{pagedata.post.isboardtop}}" ><i class="icon icon-zhiding"></i> <span ng-click='pagedata.boardtop(pagedata.post.id)' ng-if="pagedata.post.isboardtop!=1" class="topdiv">设置置顶</span> <span ng-click='pagedata.boardtop(pagedata.post.id)' ng-if="pagedata.post.isboardtop==1" class="topdiv">取消置顶</span></a>              
            </div>           
            <div   ng-if="pagedata.isSuperManager==1"  class="fui-article-subtitle ">
                 <span class="pull-right">
                    <i class="icon icon-browse"></i> 浏览：{{pagedata.post.views}}
                </span>
                <a href="javascript:;" class="link" id="btnBestAll" isbest="{{pagedata.post.isbest}}" ><i class="icon icon-creditlevel"></i> <span ng-click='pagedata.best(pagedata.post.id)' ng-if="pagedata.post.isbest!=1" class="bestdiv">设置全站精华</span> <span ng-click='pagedata.best(pagedata.post.id)' ng-if="pagedata.post.isbest==1" class="bestdiv">取消全站精华</span> &nbsp;</a>
                <a href="javascript:;" class="link" id="btnTopAll" istop="{{pagedata.post.istop}}" ><i class="icon icon-zhiding"></i> <span class="topdiv" ng-click='pagedata.top(pagedata.post.id)' ng-if="pagedata.post.istop!=1">设置全站置顶</span> <span class="topdiv" ng-click='pagedata.top(pagedata.post.id)' ng-if="pagedata.post.istop==1">取消全站置顶</span>&nbsp;</a>
            </div>
			   
        <a ng-click="access_json('/post.index/reply/id='+pagedata.post.id)" class="nav-item" href="#" id="btnReply">
            <i class="icon jinyunicon icon-pingjia3"></i> <span ng-if="pagedata.replycount>0" id="commentdiv">{{pagedata.replycount}}</span><span ng-if="pagedata.replycount<=0" id="commentdiv">评论</span>
        </a>
        <a class="nav-item" ng-click="pagedata.onegood(pagedata.post.id)" id="btnGood">
            <i ng-class="{'icon jinyunicon icon-good':1,'fill':pagedata.isgood>0}" isgood="{{pagedata.isgood}}"></i> <span ng-if="pagedata.goodcount>0" id="zandiv">{{pagedata.goodcount}}</span> <span ng-if="pagedata.goodcount<=0" id="zandiv">赞</span>
        </a>
        <a ng-click="access_json('/post.index/complain/id='+pagedata.post.id)" class="nav-item" id="btnComplain" data-id="{pagedata.post.id}}" href="javascript:void(0);">
            <i class="icon jinyunicon icon-warning"></i> <span>投诉</span>
        </a>

        </div>
        <div class="fui-cell-group">
            <div class="fui-cell-title"><i class="icon icon-comment"></i> 全部评论</div>
			<div ng-if="pagedata.list==''" style="text-align:center;padding:10px">已经没有更多内容了哦！</div>
            <p ng-if="pagedata.list==''" class='text-center text-cancel empty' ><i class="icon icon-commentfill" style="font-size:4rem;color:#ccc;"></i> <br/>暂时没有任何评论</p>
            <div class='fui-list-group reply-list-group' style='margin-top:0;display: none'></div>

        </div>
    <div id="tpl_post_reply_list">
       
        <div ng-repeat="(k,row) in pagedata.list" class="fui-list external reply-list"
              data-pid ="{{row.id}}"
              data-nickname="{{row.nickname}}">
            <a class="fui-list-media reply-avatar" ng-click="access_json('/user.index//id='+row.mid)"  data-nocache="true">
                <img src="{{row.avatar}}" class="round">
            </a>
            <div class="fui-list-inner">
                <div class="text click">
                    
                    {{row.nickname}}
                    <span class="level-label fui-label fui-label-default level-label" style="background:{{row.level.bg}};color:{{row.level.color}}">{{row.level.levelname}}</span>
                    
                    <span ng-if="row.isAuthor==1" class="level-label fui-label fui-label-warning level-label">楼主</span>    
                    <span ng-if="row.isManager==1" class="level-label fui-label fui-label-danger level-label">版主</span>
                    
                </div>
                <div ng-bind-html='trust(row.content)' class="text text-reply  click"></div>
				<a  class="fui-card-images"   >
					<img  ng-src="{{row.images}}" style="background-image:url('{{row.images}}');width:{{row.imagewidth}}" />
					
				</a>
                <div ng-if="row.parent!=''" class="text text-parent">
                    <span class="org">@{{row.parent.nickname}}</span>: {{row.parent.content}}
                </div>
                <div class="text text-time">
                  
                    <span class="pull-right">
                        <a ng-click="access_json('/post.index/reply/id='+pagedata.post.id+'&rid='+row.id)" class="link link-reply" ><i class="icon icon-pingjia3"></i> 回复&nbsp;&nbsp;</a>
                        <a  ng-click='pagedata.good(k,row.id)' class="link link-good" isgood="{{row.isgood}}" ><i id="i{{k}}" ng-show="row.isgood==1" style="color:red" class="icon icon-good" ng-class="{'fill':row.isgood>0}"></i> <i id="j{{k}}" ng-show="row.isgood!=1" class="icon icon-good" ng-class="{'fill':row.isgood>0}"></i>
                           <span  class="zandiv"  ng-if="row.goodcount<=0">赞</span>
							<span class="zandiv"  ng-if="row.goodcount>0">{{row.goodcount}}</span>&nbsp;&nbsp;</a>
                        <a ng-click="access_json('/post.index/complain/id='+pagedata.post.id)"  class="link link-complain-list" data-id="{{row.id}}" href="javascript:void(0);">
                            <i class="icon icon-warning"></i> <span>投诉</span>
                        </a>

                   
                        <a ng-if="pagedata.isManager==1 || pagedata.isSuperManager==1 && row.checked!=1 " ng-click='pagedata.check(pagedata.post.id)' class="link link-check " ><i class="icon icon-check"></i> 审核&nbsp;&nbsp;</a>
                  
                        <a  ng-if="pagedata.isManager==1 || pagedata.isSuperManager==1" ng-click='pagedata.delete(pagedata.post.id)' class="link link-delete" ><i class="icon icon-delete"></i> 删除</a>
                   
                        </span>
                   

                    {{row.createtime}}
                </div>
            </div>
        </div>
       
    </div>
	<div ng-if="pagedata.list!=''" style="text-align:center;padding:10px">已经没有更多内容了哦！</div>
</div>
</div>
<div ng-if="pagedata.op=='reply'" id="sns-board-reply-page" class='fui-page sns-board-reply-page'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();">取消</a>
        </div>
        <div class="title">回复话题</div>
        <div class="fui-header-right"></div>
    </div>
    <div class="fui-content">
        <div class="fui-cell-group" style="margin-top:0;">
            <div class="fui-cell">
                <div class="fui-cell-info">
                    <textarea placeholder="内容 10-1000个字"  ng-model="pagedata.item.content" rows="8" id="content"></textarea>
                </div>
            </div>
						<div class="fui-list jump">
								<a class="fui-list-media" ng-if="pagedata.item.images">
									<img class="round" src="{{tomedia(pagedata.item.images) || '../core/resource/images/nopic.jpg'}}" />
								</a>
								<a class="fui-list-media weui_uploader_input_wrp">
									<input class="weui_uploader_input" ng-click="up_file(pagedata.item,'images','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
								</a>
							</div>

		
        <a	ng-click="post(pagedata.item,'post')" class="btn btn-sns-submit" style="line-height:1rem;height:1.8rem" id="btnSend">提交</a>
    </div>

	</div>
</div>
<!--投诉start-->
<div ng-if="pagedata.op=='complain'" id="sns-board-complain-page" class='fui-page sns-board-reply-page'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();">取消</a>
        </div>
        <div class="title">投诉</div>
        <div class="fui-header-right"></div>
    </div>
    <div class="fui-content navbar">
        <div class="fui-cell-group" style="margin-top:0;">
           
            <input type="hidden" id="complain_type" name="complain_type" value="">
           
			<select   ng-model="pagedata.item.type" style="margin: 0.5rem;padding: 0.3rem;font-size: 0.7rem;">
						<option  value="">选择投诉类别</option>
					   <option   ng-repeat="v in pagedata.catelist" value="{{v.id}}">{{v.name}}</option>
                       
            </select>
            <div class="fui-cell">
                <div class="fui-cell-info">
                    <textarea placeholder="内容 10-1000个字"  ng-model="pagedata.item.content" rows="8" id="complain_text"></textarea>
                </div>
            </div>
          

            <div ng-if="pagedata.board.noimage==''" class='fui-cell complain-image'>
                <div class='fui-cell-info'>
                    <ul class="fui-images fui-images-md"></ul>
                    <div class="fui-uploader fui-uploader-md"
                         data-max="{{pagedata.set.imagesnum}}"
                         data-count="0">
                        <input type="file" name='complainimg[]' id='complainimg{{pagedata.g.id}}' multiple="" accept="image/*" >
                    </div>
                </div>
            </div>
        </div>
        <a ng-click="post(pagedata.item,'post1')" class="btn btn-sns-submit" style="line-height:1rem;height:1.8rem" id="btnCompSend">提交</a>
    </div>
</div>

<div ng-include="sys_html('_menu')"></div>

<script language='javascript'>
scope.pagedata.good=function(k,id){
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'good',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
						if(data=='jia'){
							scope.pagedata.list[k].goodcount=parseInt(scope.pagedata.list[k].goodcount)+1;
							$("#i"+k).css("color","red");	
							scope.pagedata.list[k].isgood=1;
						}
						if(data=='jian'){
							scope.pagedata.list[k].goodcount=parseInt(scope.pagedata.list[k].goodcount)-1;	
							scope.pagedata.list[k].isgood=0;
							$("#i"+k).css("color","")	
							
						}
						scope.$apply();	
					}
		}
		scope.post_json(params);
}
scope.pagedata.onegood=function(id){
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'good',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
						if(data=='jia'){
							scope.pagedata.goodcount++;
							$("#i"+k).css("color","red");	
							scope.pagedata.isgood=1;
						}
						if(data=='jian'){
							scope.pagedata.goodcount--;	
							scope.pagedata.isgood=0;
							$("#i"+k).css("color","")	
							
						}
						scope.$apply();	
					}
		}
		scope.post_json(params);
}
		scope.pagedata.boardbest=function(id){
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'boardbest',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
							
					}
		}
		scope.post_json(params);
		}
		scope.pagedata.best=function(id){
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'best',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
							
					}
		}
		scope.post_json(params);
		}
		scope.pagedata.top=function(id){
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'top',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
							
					}
		}
		scope.post_json(params);
		}
		
		scope.pagedata.boardtop=function(id){
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'boardtop',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
							
					}
		}
		scope.post_json(params);
		}
		scope.pagedata.check=function(id){
		
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'check',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
							
					}
		}
		scope.post_json(params);
		}
		scope.pagedata.delete=function(id){
		var params = {
					'plugin':'jy_sns',
					'action':'post.index',
					'op':'delete',
					'data':{
						'id':id,
						
					},
					'callback':function(data){
							
					}
		}
		scope.post_json(params);
		}
		
</script>

